<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>外卖管理系统 - 美食随心订</title>
    <link rel="stylesheet" href="{% templates 'css/style.css' %}">
    <link rel="stylesheet" href="{% templates 'css/home.css' %}">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
        <div class="container">
            <a class="navbar-brand" href="{% url 'home' %}"><i class="fas fa-utensils"></i> 外卖管理系统</a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav me-auto">
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'restaurant_list' %}">餐厅列表</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{% url 'order_list' %}">我的订单</a>
                    </li>
                </ul>
                <ul class="navbar-nav">
                    {% if user.is_authenticated %}
                        <li class="nav-item">
                            <a class="nav-link" href="{% url 'profile' %}">个人中心</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="{% url 'logout' %}">退出</a>
                        </li>
                    {% else %}
                        <li class="nav-item">
                            <a class="nav-link" href="{% url 'login' %}">登录</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="{% url 'register' %}">注册</a>
                        </li>
                    {% endif %}
                </ul>
            </div>
        </div>
    </nav>

    <!-- 消息提示 -->
    {% if messages %}
    <div class="container mt-3">
        {% for message in messages %}
            <div class="alert alert-{{ message.tags }} alert-dismissible fade show">
                {{ message }}
                <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
            </div>
        {% endfor %}
    </div>
    {% endif %}

    <!-- 主要内容 -->
    <main class="container mt-4">
        <section class="hero text-center">
            <h2>美食触手可及</h2>
            <p>从众多精选餐厅中选择您喜爱的美食，足不出户享受美味</p>
        </section>

        <section class="search-section">
            <div class="search-bar">
                <input type="text" placeholder="搜索餐厅、美食或菜系...">
                <button type="button">
                    <i class="fas fa-search"></i> 搜索
                </button>
            </div>
        </section>

        <section class="quick-actions">
            <div class="quick-action-item">
                <i class="fas fa-clock"></i>
                <h4>限时优惠</h4>
                <p>限时特价美食</p>
            </div>
            <div class="quick-action-item">
                <i class="fas fa-percent"></i>
                <h4>优惠券</h4>
                <p>领取专属优惠</p>
            </div>
            <div class="quick-action-item">
                <i class="fas fa-user-friends"></i>
                <h4>邀请有礼</h4>
                <p>邀请好友送券</p>
            </div>
            <div class="quick-action-item">
                <i class="fas fa-crown"></i>
                <h4>会员专享</h4>
                <p>专属特权福利</p>
            </div>
        </section>

        <section class="categories">
            <div class="section-header">
                <h2>美食分类</h2>
                <p>探索各式各样的美食世界</p>
            </div>
            <div class="category-grid">
                <div class="category-card">
                    <div class="category-image" style="background-image: url('images/chinese.jpg');"></div>
                    <div class="category-content">
                        <h3>中式料理</h3>
                        <p>传统美味，经典传承</p>
                    </div>
                </div>
                <div class="category-card">
                    <div class="category-image" style="background-image: url('images/japanese.jpg');"></div>
                    <div class="category-content">
                        <h3>日式料理</h3>
                        <p>精致典雅，品质保证</p>
                    </div>
                </div>
                <div class="category-card">
                    <div class="category-image" style="background-image: url('images/western.jpg');"></div>
                    <div class="category-content">
                        <h3>西式快餐</h3>
                        <p>快捷美味，随时享用</p>
                    </div>
                </div>
                <div class="category-card">
                    <div class="category-image" style="background-image: url('images/dessert.jpg');"></div>
                    <div class="category-content">
                        <h3>甜点饮品</h3>
                        <p>甜蜜时光，美好心情</p>
                    </div>
                </div>
            </div>
        </section>

        <section class="featured-restaurants">
            <div class="section-header">
                <h2>精选餐厅</h2>
                <p>严选优质商家，提供卓越美食体验</p>
            </div>
            <div class="restaurant-grid">
                <!-- 餐厅信息卡片 -->
                <div class="restaurant-card">
                    <div class="restaurant-image" style="background-image: url('images/restaurant1.jpg');"></div>
                    <div class="restaurant-info">
                        <h3 class="restaurant-name">江南小厨</h3>
                        <div class="restaurant-details">
                            <span class="restaurant-rating"><i class="fas fa-star"></i> 4.8</span>
                            <span class="restaurant-cuisine">江浙菜</span>
                        </div>
                        <div class="restaurant-tags">
                            <span class="tag">新店特惠</span>
                            <span class="tag">支持自取</span>
                        </div>
                        <div class="restaurant-delivery">
                            <span class="delivery-time"><i class="fas fa-clock"></i> 30-45 分钟</span>
                            <span class="delivery-fee">配送费 ¥5</span>
                        </div>
                    </div>
                </div>
                <!-- 更多餐厅卡片可以继续添加 -->
            </div>
        </section>
    </main>

    <footer class="footer mt-auto py-3 bg-light">
        <div class="container text-center">
            <span class="text-muted">© 2024 外卖管理系统</span>
        </div>
    </footer>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
    <script src="{% static 'js/home.js' %}"></script>
</body>
</html>
